#pragma once
#include<pthread.h>

namespace condmodule
{
    class cond
    {
    public:
        cond(){
            pthread_cond_init(&_cond,nullptr);
        }
        void wait(pthread_mutex_t* lock_ptr){
            pthread_cond_wait(&_cond,lock_ptr);
        }
        void Nodify()
        {
            pthread_cond_signal(&_cond);
        }
        void Nodifyall(){
            pthread_cond_broadcast(&_cond);
        }
        ~cond(){
            pthread_cond_destroy(&_cond);
        }
    private:
        pthread_cond_t _cond;
    };
}